package model;

import java.util.ArrayList;

public class Bank {
	int free_park=0;
	public ArrayList<Card> city;
	public Bank(){
		city = new ArrayList<>();
		for(int i=0; i<Card.deckCity.size();i++){
			city.add(Card.deckCity.get(i));
		}
	}
	
	public void give(Player p, int amount){
		p.account += amount;
	}
	
	public int winMid(Player p){
		int free = free_park;
		p.account+=free_park;
		free_park=0;
		return free;
	}
	
	//Pay the bank (like fees)
	public void payBank(Player p, int amount){
		p.account-=amount;
	}
	
	//when someone must pay a amount to an other player
	public void payPlayer(Player debtor, int amount, Player creditor){
		debtor.account-=amount;
		creditor.account+=amount;
	}
	
	//the money who go on the middle
	public void payToMid(Player p,int amount){
		payBank(p,amount);
		free_park+=amount;
	}
}
